handle heterogeneous arrays in flattening pass - #660
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74c9383a7b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf4ba11ae4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 44d8aafd08
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0414c2294
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
llzk-lib/lib/Dialect/Polymorphic/Transforms/FlatteningPass.cpp
Lines 1964 to 1969 in bf67a58
When the partially instantiated function contains a flat call to a sibling function in the original template, the cloned template contains only the remaining parameters, copied expressions, and newFunc; it does not contain that sibling. The flat callee consequently resolves relative to the new template and becomes an unknown symbol, so applyBodyConversions() rejects an otherwise valid partial instantiation. Copy referenced sibling functions recursively or rewrite such callees to a path that still resolves in the original template.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
it already has a failure though
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 755ef86fa9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
llzk-lib/lib/Dialect/Polymorphic/Transforms/FlatteningPass.cpp
Lines 5105 to 5106 in 31655b6
When a member-read refinement changes every array.new initializer to a concrete type, this mutation updates the array SSA value globally without checking consumers of that array. A generic array can initially be passed to a call expecting array<Cell<1>>, while its generic initializer is later refined to Cell<0> by another member write; this branch changes the argument to array<Cell<0>>, and no propagation pattern updates the callee parameter, leaving the call invalid. Check the array value's typed consumers before committing the initializer-driven element refinement.
llzk-lib/lib/Dialect/Polymorphic/Transforms/FlatteningPass.cpp
Lines 1513 to 1515 in 31655b6
When function instantiation resolves a wildcard scalar element to an array, this replacement creates an ExtractArrayOp without copying the original ReadArrayOp's discardable attributes. An annotated read therefore loses metadata such as product_source specifically along the new scalar-to-ranged conversion path; transfer the source read's discardable attribute dictionary to the replacement.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 39 out of 40 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
include/llzk/Dialect/Polymorphic/Transforms/TransformationPasses.td:62
- This documentation names
poly.const_read, but the registered operation ispoly.read_const(include/llzk/Dialect/Polymorphic/IR/Ops.td:236). Use the actual operation spelling so users can find and invoke it.
- Replace instantiated `poly.const_read` uses, symbolic member table
test/Transforms/Flattening/test/Transforms/Flattening/member_read_array_initializer_reproducer.llzk:1
- This test was added under a duplicated
test/Transforms/Flatteningdirectory hierarchy, unlike the other flattening tests. Move it totest/Transforms/Flattening/member_read_array_initializer_reproducer.llzkso the suite layout and reported test path remain consistent.
| } | ||
| } | ||
| return success(); |
Summary
Update flattening pass to create a series of flattened structs for an array of heterogeneous structs.
Related issues
Fixes #296